package Homeworks.HOMEWORK0320.DengLu;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        String yongHuMing="admin";
        String miMa="admin";
        Scanner sc=new Scanner(System.in);
        int jiHui=3;
        String in1;
        String in2;
        while (true){
            System.out.println("输入用户名");
            in1=sc.nextLine();

            System.out.println("输入密码");
            in2=sc.nextLine();

            if(in1.equals(yongHuMing)&&in2.equals(miMa)){
                System.out.println("登录成功");
                break;
            }else {
                jiHui--;
                if (jiHui==0){
                    System.out.println("登录失败，账户锁定");
                    break;
                }else{
                    System.out.printf("登录失败，还有%d次机会\n",jiHui);
                }
            }
        }
    }


}
